/* 消息列表页面样式 */

.message-list {
  height: 100vh;
  background-color: #f5f5f5;
}

.message-header {
  background-color: #fff;
  padding: 16px 20px;
  font-weight: bold;
  font-size: 20px;
  color: #333;
  border-bottom: 1px solid #eee;
}

.message-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background-color: #fff;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
  min-height: 80px;
  
  &:active {
    background-color: #f0f0f0;
  }
}

.message-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-right: 16px;
  flex-shrink: 0;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #999;
  overflow: hidden;
  
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.message-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.message-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.message-username-container {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.message-username {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-doctor-info {
  font-size: 14px;
  color: #666;
  margin-left: 6px;
  flex-shrink: 0;
}

.message-time {
  color: #999;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 12px;
}

.message-preview {
  color: #888;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
}

.message-unread {
  margin-left: 12px;
  color: #e54d42;
  font-size: 14px;
  background-color: #ffebee;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 500;
  min-width: 20px;
  text-align: center;
}

.message-empty {
  padding: 40px 24px;
  text-align: center;
  color: #888;
  font-size: 14px;
  background-color: #fff;
  margin: 12px 16px;
  border-radius: 8px;
}

/* 未读消息样式 */
.message-item.has-unread {
  background-color: #f8f9ff;
  
  .message-username {
    font-weight: 700;
  }
  
  .message-preview {
    color: #666;
  }
}

/* 最后一条消息是图片的样式 */
.message-preview.image-message {
  color: #4096ff;
  font-style: italic;
}

/* 最后一条消息是语音的样式 */
.message-preview.voice-message {
  color: #666;
  
  &::before {
    content: "🎵 ";
    margin-right: 4px;
  }
}
